headings_em <- read_csv("data/raw/headings-emilian.csv")
## Rows: 192 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): old, new
## dbl (1): col_id
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
headings_eo <- read_csv("data/raw/headings-esperanto.csv")
## Rows: 175 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): old, new
## dbl (1): col_id
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
emilian <- read_csv("data/raw/emilian-clean.csv", skip = 1, col_names = headings_em$new, na = c("", "NA", "na")) %>%
mutate(
understand = factor(understand, levels = c("NO", "AL", "50/50", "G", "VG")),
speak = factor(speak, levels = c("NO", "AL", "50/50", "G", "VG"))
)
## Rows: 434 Columns: 192
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (174): id, gender, education, profession_it, profession, birth_place_it,...
## dbl (9): age, educated, intelligent, diligent, friendly, kind, trustworthy...
## lgl (9): Q14, Q15, Q16, calculations_comments, throughts_comments, Q21, em...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
esperanto <- read_csv("data/raw/esperanto-clean.csv", skip = 1, col_names = headings_eo$new, na = c("", "NA", "na")) %>%
mutate(
age = str_remove(age, "jaroj"),
age = str_replace(age, "naskiĝis en la 1995a", "25"),
age = as.numeric(age),
understand = factor(understand, levels = c("NO", "AL", "50/50", "G", "VG")),
speak = factor(speak, levels = c("NO", "AL", "50/50", "G", "VG"))
)
## Rows: 154 Columns: 175
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (161): id, gender, gender_other, age, education, profession_eo, professi...
## dbl (8): educated, intelligent, diligent, friendly, kind, trustworthy, ref...
## lgl (6): Q13, Q14, Q15, Q19, Q20, Q32
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
emilian %>%
ggplot(aes(gender)) +
geom_bar()
emilian %>%
ggplot(aes(age)) +
geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
emilian %>%
ggplot(aes(age)) +
geom_density()
emilian %>%
ggplot(aes(education)) +
geom_bar()
emilian %>%
ggplot(aes(age, education)) +
geom_jitter(height = 0.2, alpha = 0.5)
emilian %>%
count(profession) %>%
ggplot(aes(reorder(profession, -n), n)) +
geom_bar(stat = "identity")
emilian %>%
count(languages_family) %>%
ggplot(aes(reorder(languages_family, -n), n)) +
geom_bar(stat = "identity")
emilian %>%
count(languages_parents) %>%
ggplot(aes(reorder(languages_parents, -n), n)) +
geom_bar(stat = "identity")
emilian %>%
ggplot(aes(understand, fill = understand)) +
geom_bar() +
scale_fill_brewer(type = "div") +
theme_dark()
emilian %>%
ggplot(aes(understand, fill = gender)) +
geom_bar()
emilian %>%
ggplot(aes(understand, fill = gender)) +
geom_bar(position = "fill")
emilian %>%
ggplot(aes(age, fill = understand)) +
geom_histogram(binwidth = 5) +
facet_grid(understand ~ .)
emilian %>%
ggplot(aes(understand, fill = profession)) +
geom_bar()
emilian %>%
ggplot(aes(understand, fill = profession)) +
geom_bar(position = "fill")
emilian %>%
ggplot(aes(speak, fill = speak)) +
geom_bar() +
scale_fill_brewer(type = "div")
emilian %>%
ggplot(aes(speak, fill = gender)) +
geom_bar()
emilian %>%
ggplot(aes(speak, fill = gender)) +
geom_bar(position = "fill")
esperanto %>%
ggplot(aes(age, fill = speak)) +
geom_histogram(binwidth = 5) +
facet_grid(speak ~ .)
emilian %>%
ggplot(aes(speak, fill = profession)) +
geom_bar()
emilian %>%
ggplot(aes(speak, fill = profession)) +
geom_bar(position = "fill")
emilian %>%
ggplot(aes(read_write, fill = read_write)) +
geom_bar()
emilian %>%
ggplot(aes(read_write, fill = gender)) +
geom_bar()
emilian %>%
ggplot(aes(read_write, fill = gender)) +
geom_bar(position = "fill")
emilian %>%
drop_na(read_write) %>%
ggplot(aes(age, fill = read_write)) +
geom_histogram(binwidth = 5) +
facet_grid(read_write ~ .)
emilian %>%
ggplot(aes(read_write, fill = profession)) +
geom_bar()
emilian %>%
ggplot(aes(read_write, fill = profession)) +
geom_bar(position = "fill")
emilian %>%
select(educated:familiar) %>%
pivot_longer(educated:familiar, names_to = "feature", values_to = "rating") %>%
ggplot(aes(as.factor(rating), fill = as.factor(rating))) +
geom_bar() +
scale_fill_brewer() +
facet_grid(. ~ feature)
emilian %>%
select(educated:familiar) %>%
pivot_longer(educated:familiar, names_to = "feature", values_to = "rating") %>%
ggplot(aes(feature, fill = as.factor(rating))) +
geom_bar(position = "fill") +
scale_fill_brewer()
esperanto %>%
ggplot(aes(gender)) +
geom_bar()
esperanto %>%
ggplot(aes(age)) +
geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
esperanto %>%
ggplot(aes(age)) +
geom_density()
esperanto %>%
ggplot(aes(education)) +
geom_bar()
esperanto %>%
ggplot(aes(age, education)) +
geom_jitter(height = 0.2, alpha = 0.5)
esperanto %>%
count(profession) %>%
ggplot(aes(reorder(profession, -n), n)) +
geom_bar(stat = "identity")
esperanto %>%
count(languages_family) %>%
ggplot(aes(reorder(languages_family, -n), n)) +
geom_bar(stat = "identity")
esperanto %>%
ggplot(aes(understand, fill = understand)) +
geom_bar() +
scale_fill_brewer(type = "div") +
theme_dark()
esperanto %>%
ggplot(aes(understand, fill = gender)) +
geom_bar()
esperanto %>%
ggplot(aes(understand, fill = gender)) +
geom_bar(position = "fill")
esperanto %>%
ggplot(aes(age, fill = understand)) +
geom_histogram(binwidth = 5) +
facet_grid(understand ~ .)
esperanto %>%
ggplot(aes(understand, fill = profession)) +
geom_bar()
esperanto %>%
ggplot(aes(understand, fill = profession)) +
geom_bar(position = "fill")
esperanto %>%
ggplot(aes(speak, fill = speak)) +
geom_bar() +
scale_fill_brewer(type = "div")
esperanto %>%
ggplot(aes(speak, fill = gender)) +
geom_bar()
esperanto %>%
ggplot(aes(speak, fill = gender)) +
geom_bar(position = "fill")
esperanto %>%
ggplot(aes(age, fill = speak)) +
geom_histogram(binwidth = 5) +
facet_grid(speak ~ .)
esperanto %>%
ggplot(aes(speak, fill = profession)) +
geom_bar()
esperanto %>%
ggplot(aes(speak, fill = profession)) +
geom_bar(position = "fill")
esperanto %>%
ggplot(aes(read_write, fill = read_write)) +
geom_bar()
esperanto %>%
select(educated:familiar) %>%
pivot_longer(educated:familiar, names_to = "feature", values_to = "rating") %>%
drop_na() %>%
ggplot(aes(as.factor(rating), fill = as.factor(rating))) +
geom_bar() +
scale_fill_brewer() +
facet_grid(. ~ feature)
esperanto %>%
select(educated:familiar) %>%
pivot_longer(educated:familiar, names_to = "feature", values_to = "rating") %>%
drop_na() %>%
ggplot(aes(feature, fill = as.factor(rating))) +
geom_bar(position = "fill") +
scale_fill_brewer()